

package bibliotheque.document;

import java.io.Serializable;

public class DocumentId implements Serializable {
    
    
    private String ip;
    private int id;
    
    public DocumentId(String server_ip, int id){
        this.ip = server_ip;      
        this.id = id;
    }
    
    public String GetIp(){
        return this.ip;
    }
    
    public int GetId(){
        return this.id;
    }

    public void SetIp (String ip){
        this.ip = ip;
    }
    
    public void SetId(int id){
        this.id = id;
    }
    
    public int hashCode(){
        return (this.id + this.ip.hashCode());
    }
    
    public boolean equals(Object obj) {
       if (obj instanceof DocumentId){
           DocumentId id = (DocumentId)obj;
           return (id.GetId() == this.id && id.ip.equals(this.ip));
       }
       else return false;
    }
}

